package com.example.backend;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class RedisProducer {

    @Autowired
    private StringRedisTemplate redisTemplate;

    public void sendMessage(String message) {
        redisTemplate.convertAndSend("eventQueue", message);
        System.out.println("Message published: " + message);
    }
}